/*
 * Copyright (C) 2018 Baidu, Inc. All Rights Reserved.
 */
package com.hongye.jpademo;

import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
// @ComponentScan({"com.hongye.jpademo"})
public class ValidationConf {

    // @Bean
    // public MethodValidationPostProcessor methodValidationPostProcessor() {
    //     return new MethodValidationPostProcessor();
    // }

    @Bean
    public Validator defaultValidator() {
        ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
        return factory.getValidator();
    }
}
